<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://unpkg.com/vue@next"></script>
</head>

<body>
  <div id="root"></div>
  <script>
    // {{}} 插值表达式
    // v-html，v-bind(:)，v-on(@), 动态参数，修饰符
    const app = Vue.createApp({
      data() {
        return {
          message: 'hello world',
          show: false,
          event: 'click',
          name: 'title'
        }
      },
      methods: {
        handleClick() {
          alert('click')
        }
      },
      /* template: `
        <div @[event]="handleClick" :[name]="message">
          {{message}}
        </div>
        <div v-if="show">
          {{message}}
        </div>
         <div v-once>
          {{message}}
        </div>  
      ` */
      template: `
        <form action="https://www.baidu.com" @click.prevent="handleClick">
          <button type="submit">提交</button>
        </form>
      `
    })
    const vm = app.mount('#root')
  </script>
</body>

</html>